#ifndef MIX_GRAPHICS_CORE_VERTEXBUFFER_HPP
#define MIX_GRAPHICS_CORE_VERTEXBUFFER_HPP

#include <string>

namespace mix
{

class VertexBuffer
{
public:
	typedef std::shared_ptr<VertexBuffer> Ptr;
	typedef ResWeakPtr<VertexBuffer> WeakPtr;

	~VertexBuffer();

	void deleteRes();

	bool resReleased() {
		return false;
	}
	
	void bind();

	int setData( const void* vData, int vNum, int vStride, const GLushort* iData = NULL, int iNum = 0);
	int setData( const GLushort* iData, int iNum);


	static Ptr create();
	static WeakPtr require( const char* identName);

private:
	VertexBuffer();
	static void onWeakPtrRelease( Ptr&);

	VertexBuffer( const VertexBuffer&);
	const VertexBuffer& operator=( const VertexBuffer&);

private:
	GLuint _vbObjs[2];

	std::string _identName;

};

}

#endif	// MIX_GRAPHICS_CORE_VERTEXBUFFER_HPP